/* You can add global styles to this file, and also import other style files */

@use 'theme/theme.scss';
@use 'scss/constants' as *;
@use 'scss/mixins' as *;

body, html {
    height: 100%;
    width: 100%;
    min-height: 100%;
    position: relative;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-touch-callout: none;

    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  body {
    margin: 0;
    padding: 0;
    background-color: #eee;
    overflow: hidden;
  }
  
  cne-root {
    margin: 0;
    width: 100%;
    min-height: 100%;
    height: 100%;
    display: block;
    box-sizing: border-box;
  }

.cne-default, 
.cne-dark {
    /*********************************
     * MATERIAL DESIGN CUSTOMIZATIONS
     ********************************/
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      &, &.mat-headline-5 {
        margin-top: 1rem;
        margin-bottom: 1rem;
      }
    }
  
    h1 {
      font-size: 3.4rem;
      font-weight: 400;
      line-height: 4rem;
    }
  
    h2 {
      font-size: 2.4rem;
      font-weight: 400;
      line-height: 3.2rem;
    }
  
    h3 {
      font-size: 2rem;
      font-weight: 500;
      letter-spacing: .005em;
    }
  
    h4 {
      font-size: 1.6rem;
      font-weight: 400;
      line-height: 2.4rem;
      letter-spacing: .01em;
    }
  
    h5 {
      font-size: 1.4rem;
      font-weight: 400;
      line-height: 2rem;
      letter-spacing: .01em;
    }
  
    h6 {
      font-size: 1.2rem;
      font-weight: 400;
      line-height: 1.6rem;
      letter-spacing: .01em;
    }
  
    mat-label {
      &.cne-title {
        font-size: 13px;
        font-weight: 400;
        color: #666;
        pointer-events: none;
  
        &.no-padding {
          padding-bottom: 0;
        }
  
        &.cne-required::after {
          font-size: 13px;
          color: rgba(0, 0, 0, .54);
          vertical-align: top;
          content: " *";
        }
  
        &.cne-error {
          color: rgb(221, 44, 0);
  
          &.cne-required::after {
            color: rgb(221, 44, 0);
          }
        }
      }
    }
  
    mat-icon {
      &.cne-error {
        color: rgb(221, 44, 0);
      }
    }
  
    .mat-mdc-tooltip {
      white-space: pre-line;
    }
  
    .cne-select-overlay {
      min-width: fit-content;
    }
  
    button {
      pointer-events: all;
    }
  
    button.mat-mdc-menu-item {
      font-size: 15px;
    }
  
    button.mat-mdc-fab.mat-fab-bottom-right {
      top: auto;
      right: 20px;
      bottom: 20px;
      left: auto;
      position: absolute;
    }
  
    .layout-padding, .layout-padding > * {
      @media #{$mat-lt-sm} {
        padding: 4px;
      }
      @media #{$mat-gt-xs} {
        padding: 8px;
      }
    }
  
    .mat-padding {
      padding: 8px;
      @media #{$mat-gt-sm} {
        padding: 16px;
      }
    }
  
    .mat-content {
      position: relative;
      overflow: auto;
    }
  
    .layout-wrap {
      flex-wrap: wrap;
    }
  
    mat-form-field.mat-block {
      display: block;
    }
  
    button.mat-mdc-menu-item {
      overflow: hidden;
      .mat-mdc-menu-item-text {
        flex: 1;
        .cne-alt-text {
          float: right;
        }
      }
    }
  
    .mat-mdc-form-field-icon-prefix, .mat-mdc-form-field-icon-suffix {
      z-index: 1;
    }
  
    .mat-toolbar.mat-mdc-table-toolbar .mat-mdc-form-field.mat-form-field-appearance-fill,
    .mat-mdc-form-field.mat-form-field-appearance-fill.cne-appearance-transparent {
      .mdc-text-field--filled {
        &:before {
          content: none;
        }
        background-color: transparent;
        padding: 0;
      }
      .mat-mdc-form-field-focus-overlay {
        &:before {
          content: none;
        }
        background-color: transparent;
      }
      .mat-mdc-select-arrow-wrapper {
        transform: none;
      }
      .mdc-text-field {
        .mdc-floating-label:not(.mdc-floating-label--float-above) {
          transform: translateY(-10%);
        }
      }
      .mat-mdc-form-field-icon-prefix, .mat-mdc-form-field-icon-suffix {
        align-self: end;
        > .mat-icon {
          padding-bottom: 4px;
        }
        .mat-mdc-icon-button.mat-mdc-button-base {
          width: 36px;
          height: 36px;
          padding: 6px;
        }
      }
      .mat-mdc-text-field-wrapper {
        .mat-mdc-form-field-flex {
          .mat-mdc-floating-label {
            top: 32px;
          }
        }
        .mat-mdc-form-field-infix {
          padding-top: 28px;
          padding-bottom: 4px;
        }
      }
    }
  
  
    .mat-toolbar.mat-primary {
      button.mat-mdc-icon-button {
        .mat-icon {
          color: white;
        }
      }
      .mat-mdc-select-value, .mat-mdc-select-arrow, .mat-mdc-select-arrow:after {
        color: white;
      }
      .mat-mdc-text-field-wrapper {
        &.mdc-text-field--outlined {
          &:not(.mdc-text-field--focused):not(.mdc-text-field--disabled):not(.mdc-text-field--invalid) {
            &:not(:hover) {
              .mdc-notched-outline {
                .mdc-notched-outline__leading, .mdc-notched-outline__trailing {
                  border-color: white;
                }
              }
            }
            &:hover {
              .mdc-notched-outline {
                .mdc-notched-outline__leading, .mdc-notched-outline__trailing {
                  border-color: rgba(255, 255, 255, 0.87);
                }
              }
            }
          }
          &:not(.mdc-text-field--disabled).mdc-text-field--focused {
            .mdc-notched-outline {
              .mdc-notched-outline__leading, .mdc-notched-outline__trailing {
                border-color: rgba(255, 255, 255, 0.67);
              }
            }
          }
        }
      }
    }
  
    .mat-toolbar.mat-mdc-table-toolbar {
      padding: 0 24px;
      &:not(.mat-primary) {
        background: #fff;
      }
      .mat-toolbar-tools {
        padding: 0;
        & > button.mat-mdc-icon-button:last-child {
          margin-right: -12px;
        }
      }
    }
  
    mat-toolbar.mat-mdc-table-toolbar:not(.mat-primary), .mat-mdc-cell, .mat-expansion-panel-header, mat-card-header.mat-mdc-card-header {
      button.mat-mdc-icon-button {
        .mat-icon {
          color: rgba(0, 0, 0, .54);
        }
        &[disabled][disabled] {
          .mat-icon {
            color: rgba(0, 0, 0, .26);
          }
        }
      }
    }
  
    .mat-mdc-table {
      width: 100%;
      max-width: 100%;
      display: table;
      table-layout: auto;
      border-collapse: separate;
      margin: 0;
      .mat-mdc-header-row {
        height: 56px;
      }
      .mat-mdc-footer-row, .mat-mdc-row {
        height: 52px;
      }
    }
  
    .cne-table-widget {
      .mat-mdc-table {
        .mat-mdc-row {
          font-size: 13px;
        }
  
        .mat-mdc-cell {
          background-color: transparent;
          color: inherit;
          font-size: inherit;
          font-family: inherit;
          font-weight: inherit;
          line-height: inherit;
          letter-spacing: inherit;
          text-transform: inherit;
        }
      }
    }
  
    .mat-mdc-footer-row::after, .mat-mdc-header-row::after, .mat-mdc-row::after {
      content: none;
    }
  
    .mat-mdc-header-row, .mat-mdc-footer-row, .mat-mdc-row {
      min-height: auto;
    }
  
    .mat-mdc-row,
    .mat-mdc-header-row {
      display: table-row;
    }
  
    .mat-mdc-header-cell, .mat-mdc-cell {
      &.mat-mdc-table-sticky {
        background-clip: padding-box;
      }
    }
  
    .mat-mdc-table {
      .mat-mdc-row {
        transition: background-color .2s;
  
        &:hover:not(.cne-current-entity) {
          background-color: #f4f4f4;
        }
  
        &.cne-current-entity {
          background-color: #e9e9e9;
        }
  
        &.cne-pointer {
          cursor: pointer;
        }
      }
    }
  
    .mat-mdc-row:not(.mat-row-select), .mat-mdc-header-row:not(.mat-row-select) {
      .mat-mdc-cell:first-child, .mat-mdc-footer-cell:first-child, .mat-mdc-header-cell:first-child {
        padding: 0 12px;
      }
      .mat-mdc-cell:nth-child(n+2):nth-last-child(n+2), .mat-mdc-footer-cell:nth-child(n+2):nth-last-child(n+2), .mat-mdc-header-cell:nth-child(n+2):nth-last-child(n+2) {
        padding: 0 28px 0 0;
      }
    }
  
    .mat-mdc-row.mat-row-select, .mat-mdc-header-row.mat-row-select {
      .mat-mdc-cell:first-child, .mat-mdc-footer-cell:first-child, .mat-mdc-header-cell:first-child {
        width: 30px;
        padding: 0 0 0 12px;
      }
      .mat-mdc-cell:nth-child(2), .mat-mdc-footer-cell:nth-child(2), .mat-mdc-header-cell:nth-child(2) {
        padding: 0 12px;
      }
      .mat-mdc-cell:nth-child(n+3):nth-last-child(n+2), .mat-mdc-footer-cell:nth-child(n+3):nth-last-child(n+2), .mat-mdc-header-cell:nth-child(n+3):nth-last-child(n+2) {
        padding: 0 28px 0 0;
      }
      &.mat-mdc-selected:not(.cne-current-entity) {
        background-color: #ededed;
      }
    }
  
    .mdc-text-field--disabled {
      a {
        pointer-events: all;
      }
    }
  
    .mat-mdc-cell,
    .mat-mdc-header-cell {
      min-width: 40px;
      word-wrap: initial;
      display: table-cell;
      box-sizing: content-box;
      line-break: unset;
      width: 0;
      overflow: hidden;
      vertical-align: middle;
      border-width: 0;
      border-bottom-width: 1px;
      border-bottom-color: rgba(0, 0, 0, 0.12);
      border-style: solid;
      text-overflow: ellipsis;
      touch-action: auto !important;
      letter-spacing: normal;
      &:last-child {
        padding: 0 12px 0 0;
      }
      &.mat-column-select {
        min-width: 40px;
        max-width: 40px;
        width: 40px;
        padding: 0 0 0 12px;
      }
      &.mat-column-actions {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
  
    .mat-mdc-header-cell {
      white-space: nowrap;
      button.mat-sort-header-button {
        display: block;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
      }
      &.mat-number-cell {
        .mat-sort-header-container {
          justify-content: flex-end;
        }
      }
    }
  
    .mat-mdc-cell {
      &.mat-number-cell {
        text-align: end;
      }
      .mat-icon {
        color: rgba(0, 0, 0, .54);
      }
      &.cne-pointer {
        cursor: pointer;
      }
    }
  
    .mdc-data-table__row:last-child .mdc-data-table__cell {
      border-bottom: 1px solid rgba(0,0,0,0.12);
    }
  
    .mat-mdc-cell, .mat-mdc-footer-cell {
      font-size: 13px;
    }
  
    .mat-mdc-cell, .mat-mdc-footer-cell, .mat-mdc-header-cell {
      height: 20px;
    }
  
    .mat-sort-header-sorted .mat-sort-header-arrow {
      opacity: 1 !important;
    }
  
    .mat-toolbar-tools {
      //font-size: 20px;
      letter-spacing: .005em;
      //box-sizing: border-box;
      font-weight: 400;
      display: flex;
      align-items: center;
      flex-direction: row;
      width: 100%;
      height: 64px;
      //max-height: 64px;
      padding: 0 16px;
      //margin: 0;
    }
  
    .mat-icon {
      svg {
        vertical-align: inherit;
      }
      &.cne-mat-12 {
        @include cne-mat-icon-size(12);
      }
      &.cne-mat-16 {
        @include cne-mat-icon-size(16);
      }
      &.cne-mat-18 {
        @include cne-mat-icon-size(18);
      }
      &.cne-mat-20 {
        @include cne-mat-icon-size(20);
      }
      &.cne-mat-24 {
        @include cne-mat-icon-size(24);
      }
      &.cne-mat-28 {
        @include cne-mat-icon-size(28);
      }
      &.cne-mat-32 {
        @include cne-mat-icon-size(32);
      }
      &.cne-mat-96 {
        @include cne-mat-icon-size(96);
      }
    }
  
    .mat-mdc-icon-button {
      &.cne-mat-16 {
        @include cne-mat-icon-button-size(16);
        .mat-icon {
          @include cne-mat-icon-size(16);
        }
      }
      &.cne-mat-20 {
        @include cne-mat-icon-button-size(20);
        .mat-icon {
          @include cne-mat-icon-size(20);
        }
      }
      &.cne-mat-24 {
        @include cne-mat-icon-button-size(24);
      }
      &.cne-mat-28 {
        @include cne-mat-icon-button-size(28);
      }
      &.cne-mat-32 {
        @include cne-mat-icon-button-size(32);
      }
      &.cne-mat-40 {
        @include cne-mat-icon-button-size(40);
      }
      &.cne-mat-96 {
        @include cne-mat-icon-button-size(96);
      }
    }
  
    .mat-mdc-snack-bar-container {
      position: absolute;
      background: none;
      box-shadow: none;
      margin: 0;
      padding: 0;
      border: none;
      border-radius: inherit;
      max-width: inherit;
      min-width: inherit;
      pointer-events: none;
      display: flex;
      .mdc-snackbar__surface {
        padding: 0;
        border: none;
        background: none;
        box-shadow: none;
      }
      .mdc-snackbar__label {
        padding: 0;
      }
    }
  
    .mat-drawer-side {
      border: none;
    }
  
    .mat-drawer-inner-container {
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
  
    mat-drawer.cne-details-drawer {
      z-index: 59 !important;
      width: 100% !important;
      max-width: 100% !important;
      @media #{$mat-gt-sm} {
        width: 80% !important;
      }
      @media #{$mat-gt-md} {
        width: 65% !important;
      }
    }
  
    .mat-mdc-card-subtitle, .mat-mdc-card-content {
      font-size: 16px;
    }
  
    .mat-toolbar > button:first-child {
      margin-left: -8px;
    }
  
    .mat-toolbar > button:last-child {
      margin-right: -8px;
    }
  
    .mat-toolbar {
      line-height: normal;
  
      h1, h2, h3, h4, h5, h6 {
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  
    mat-toolbar *, mat-toolbar :after, mat-toolbar :before {
      box-sizing: border-box;
    }
  
    .mat-mdc-button, .mat-mdc-unelevated-button, .mat-mdc-outlined-button, .mat-mdc-raised-button {
      &:not(.mat-mdc-icon-button) {
        @media #{$mat-lt-md} {
          padding: 0 6px;
          min-width: 88px;
        }
        .mat-icon {
          margin-right: 5px;
        }
      }
    }
  
    .cne-dialog {
      .mat-mdc-dialog-container {
        padding: 0;
        > *:first-child, form {
          max-width: 100%;
          min-width: 100%;
          display: flex;
          flex-direction: column;
        }
        .mat-mdc-dialog-content {
          margin: 0;
          padding: 24px;
        }
        .mat-mdc-dialog-actions {
          margin-bottom: 0;
          padding: 8px;
        }
        .mdc-dialog__surface {
          display: block;
        }
      }
    }
  
    .cne-fullscreen-dialog-gt-xs {
      @media #{$mat-gt-xs} {
        min-height: 100%;
        min-width: 100%;
        max-width: none !important;
        position: absolute !important;
        inset: 0;
        .mat-mdc-dialog-container {
          > *:first-child, form {
            min-width: 100% !important;
          }
          .mat-mdc-dialog-content {
            max-height: 100%;
          }
        }
      }
    }
  
    .cne-fullscreen-dialog {
      @media #{$mat-lt-sm} {
        min-height: 100%;
        min-width: 100%;
        max-width: none !important;
        position: absolute !important;
        inset: 0;
        .mat-mdc-dialog-container {
          > *:first-child, form {
            min-width: 100% !important;
            height: 100%;
          }
          .mat-mdc-dialog-content {
            max-height: 100%;
          }
        }
      }
    }
  
    .cne-absolute-fill {
      position: absolute;
      inset: 0;
    }
  
    .cne-layout-fill {
      margin: 0;
      width: 100%;
      min-height: 100%;
      height: 100%;
    }
  
    .cne-progress-cover {
      position: absolute;
      inset: 0;
      z-index: 6;
      background-color: #eee;
      opacity: 1;
    }
  
    .mat-mdc-button.cne-fullscreen-button-style,
    .cne-fullscreen-button-style {
      background: #ccc;
      opacity: .85;
  
      .mat-icon {
        color: #666;
      }
    }
  
    span.no-data-found {
      position: relative;
      display: flex;
      height: calc(100% - 60px);
      text-align: center;
    }
  
    .mat-mdc-tab-group {
      &.cne-headless {
        margin-top: -50px;
      }
      .mat-mdc-tab-header {
        border-bottom: 1px solid #0000001f;
      }
    }
  
    .cne-primary-background {
      background-color: $cne-primary-color;
    }
  
    .cne-color-preview {
      cursor: pointer;
      box-sizing: border-box;
      position: relative;
      width: 24px;
      min-width: 24px;
      height: 24px;
      overflow: hidden;
      content: "";
      border: 2px solid #fff;
      border-radius: 50%;
      box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .14), 0 2px 2px 0 rgba(0, 0, 0, .098), 0 1px 5px 0 rgba(0, 0, 0, .084);
  
      &.box {
        border: none;
        box-shadow: none;
        border-radius: 4px;
        .cne-color-result {
          position: relative;
          &:after {
            content: '';
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            border-radius: 4px;
            border: 1px solid rgba(0, 0, 0, 0.12);
          }
        }
        &.disabled {
          cursor: initial;
          .cne-color-result {
            background: rgba(0, 0, 0, 0.38);
          }
        }
      }
  
      &.small {
        width: 18px;
        min-width: 18px;
        height: 18px;
      }
  
      @include cne-checkered-bg();
  
      .cne-color-result {
        width: 100%;
        height: 100%;
      }
    }
  
    .cne-tooltip-multiline {
      max-width: 400px;
      height: auto !important;
      padding-top: 6px;
      padding-bottom: 6px;
      line-height: 1.5;
      white-space: pre-line;
    }
  
    // TinyMCE
  
    .tox-tinymce {
      button:not(.mat-mdc-menu-item):not(.mat-sort-header-button) {
        text-transform: none;
      }
    }
  
    .cne-toast-panel {
      pointer-events: none !important;
    }
  
    .cne-draggable {
      &.cdk-drag-animating {
        transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
      }
    }
  
    .cne-drop-list {
      &.cdk-drop-list-dragging {
        .cne-draggable {
          transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
        }
      }
    }
  
    .cne-drag-handle {
      cursor: move;
      .mat-icon {
        pointer-events: none;
      }
    }
  
    .cne-chip-list {
      &.mat-mdc-form-field {
        .mdc-text-field {
          .mat-mdc-form-field-infix {
            padding-top: 8px;
            padding-bottom: 8px;
            .mat-mdc-chip-grid, .mat-mdc-chip-set {
              min-height: 40px;
            }
          }
        }
      }
    }
  
    .cne-chip-row-ellipsis {
      overflow: hidden;
      .mdc-evolution-chip__cell--primary, .mdc-evolution-chip__action--primary, .mdc-evolution-chip__text-label {
        overflow: hidden;
      }
    }
  
    @media #{$mat-lt-md} {
      .mat-mdc-form-field {
        .mat-mdc-form-field-infix {
          width: auto;
        }
      }
    }
  
    .mat-expansion-panel {
      color: inherit;
    }
  
    .cursor-pointer {
      cursor: pointer;
    }
  
    .no-wrap {
      white-space: nowrap;
    }
  
    .cne-rounded-btn {
      border-radius: 20px;
      padding: 0 16px;
  
      &:not(.active, :disabled) {
        color: rgba(0, 0, 0, 0.76);
        background-color: rgba(0, 0, 0, 0.06);
      }
  
      &.active:not(:disabled) {
        --mdc-outlined-button-outline-color: $primary;
      }
  
      &:disabled {
        background: rgba(0, 0, 0, 0.06);
      }
    }
  
    &.tox-fullscreen {
      mat-sidenav.cne-site-sidenav {
        z-index: 1;
      }
    }
  }


/***************
 * TAILWIND CSS
 ***************/
@tailwind base;
@tailwind components;
@tailwind utilities;
